<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 6.1.0">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.1/css/all.min.css" integrity="sha256-DfWjNxDkM94fVBWx1H5BMMp0Zq7luBlV8QRcSES7s+0=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"example.com","root":"/","images":"/images","scheme":"Pisces","darkmode":false,"version":"8.11.1","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":false,"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"}}</script><script src="/js/config.js"></script>

    <meta name="description" content="记录备份">
<meta property="og:type" content="website">
<meta property="og:title" content="Youan">
<meta property="og:url" content="http://example.com/index.html">
<meta property="og:site_name" content="Youan">
<meta property="og:description" content="记录备份">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="lee">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="http://example.com/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":true,"isPost":false,"lang":"zh-CN","comments":"","permalink":"","path":"index.html","title":""}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>Youan</title>
  





  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">Youan</h1>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">好记性不如烂笔头</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a></li>
  </ul>
</nav>




</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-overview-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">lee</p>
  <div class="site-description" itemprop="description">记录备份</div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">10</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">6</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">12</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author site-overview-item animated">
      <span class="links-of-author-item">
        <a href="https://github.com/wslmh" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;wslmh" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:wslmh@outlook.com" title="E-Mail → mailto:wslmh@outlook.com" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
  </div>



        </div>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner index posts-expand">

    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="http://example.com/2022/09/26/%E7%BD%91%E7%BB%9C%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86%EF%BC%9AIP%E5%8D%8F%E8%AE%AE/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="lee">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Youan">
      <meta itemprop="description" content="记录备份">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | Youan">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2022/09/26/%E7%BD%91%E7%BB%9C%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86%EF%BC%9AIP%E5%8D%8F%E8%AE%AE/" class="post-title-link" itemprop="url">网络基础知识：IP协议</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2022-09-26 00:00:00" itemprop="dateCreated datePublished" datetime="2022-09-26T00:00:00+08:00">2022-09-26</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2022-12-06 16:46:16" itemprop="dateModified" datetime="2022-12-06T16:46:16+08:00">2022-12-06</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E7%BD%91%E7%BB%9C/" itemprop="url" rel="index"><span itemprop="name">网络</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="网络基础知识：IP协议"><a href="#网络基础知识：IP协议" class="headerlink" title="网络基础知识：IP协议"></a>网络基础知识：IP协议</h1><blockquote>
<p><strong>IP协议</strong><br>  IP协议提供了一种分层的、与硬件无关的寻址系统，它可以在复杂的路由式网络中传递数据所需的服务。IP协议可以将多个交换网络连接起来，在源地址和目的地址之间传送数据包。同时，它还提供数据重新组装功能，以适应不同网络对数据包大小的要求。  </p>
</blockquote>
<h2 id="一、IP协议工作方式"><a href="#一、IP协议工作方式" class="headerlink" title="一、IP协议工作方式"></a>一、IP协议工作方式</h2><p>在一个路由式网络中，源地址主机向目标地址主机发送数据时，由于网络分同网段和不同网段两种情况：</p>
<h3 id="1、同网段"><a href="#1、同网段" class="headerlink" title="1、同网段"></a>1、同网段</h3><p>如果源地址主机和目标地址主机在同一网段，目标IP地址被ARP协议（Address Resolution Protocol 地址解析协议）解析为MAC地址，然后根据MAC地址，源主机直接把数据包发给目标主机。</p>
<h3 id="2、不同网段"><a href="#2、不同网段" class="headerlink" title="2、不同网段"></a>2、不同网段</h3><p>如果源地址主机和目标地址主机在不同网段，数据包按以下过程发送：</p>
<p>1、 当前网关（一般为路由器）的IP地址被ARP协议解析为MAC地址。根据该MAC地址，源主机将数据包发送到网关。  </p>
<p>2、 网关根据数据包中的网段ID寻找目标。如果找到，将数据包发送到目标网段；如果找不到，那么重复步骤1，将数据包发送到上一级网关。</p>
<p>3、数据包经过网关被发送到正确的网段中。目标IP地址被ARP协议解析为MAC地址。根据MAC地址，数据包被发送给目标地址的主机。</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2022/09/26/%E7%BD%91%E7%BB%9C%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86%EF%BC%9AIP%E5%8D%8F%E8%AE%AE/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="http://example.com/2022/09/22/CString%E5%86%85%E5%AD%98%E7%94%B3%E8%AF%B7AllocSysString%E5%BA%94%E7%94%A8/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="lee">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Youan">
      <meta itemprop="description" content="记录备份">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | Youan">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2022/09/22/CString%E5%86%85%E5%AD%98%E7%94%B3%E8%AF%B7AllocSysString%E5%BA%94%E7%94%A8/" class="post-title-link" itemprop="url">CString应用AllocSysString申请内存</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2022-09-22 00:00:00" itemprop="dateCreated datePublished" datetime="2022-09-22T00:00:00+08:00">2022-09-22</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-01-04 20:18:35" itemprop="dateModified" datetime="2023-01-04T20:18:35+08:00">2023-01-04</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/MFC/" itemprop="url" rel="index"><span itemprop="name">MFC</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="CString内存申请接口-AllocSysString-应用"><a href="#CString内存申请接口-AllocSysString-应用" class="headerlink" title="CString内存申请接口 AllocSysString 应用"></a>CString内存申请接口 AllocSysString 应用</h1><ul>
<li><p>AllocSysString 接口申请了一块与当前CString 无关的（即当前CString 对象生命周期结束时，申请的内存依旧存在） BSTR 格式内存</p>
</li>
<li><p>接口名称：BSTR CString.AllocSysString()</p>
</li>
<li><p>使用方法，可以将返回的 BSTR 内存转为字符串，生成新的CString对象</p>
</li>
<li><p>释放内存，需要调用 ::SysFreeString(bstrParam)，释放参数类型为 BSTR</p>
</li>
</ul>

      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="http://example.com/2022/05/08/Hexo-Github%20Pages/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="lee">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Youan">
      <meta itemprop="description" content="记录备份">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | Youan">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2022/05/08/Hexo-Github%20Pages/" class="post-title-link" itemprop="url">Hexo + Github Page 建立个人博客</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2022-05-08 00:00:00" itemprop="dateCreated datePublished" datetime="2022-05-08T00:00:00+08:00">2022-05-08</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2022-12-06 16:47:47" itemprop="dateModified" datetime="2022-12-06T16:47:47+08:00">2022-12-06</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/github/" itemprop="url" rel="index"><span itemprop="name">github</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="Hexo-Github-Page-建立个人博客"><a href="#Hexo-Github-Page-建立个人博客" class="headerlink" title="Hexo + Github Page 建立个人博客"></a>Hexo + Github Page 建立个人博客</h1><h2 id="搭建博客"><a href="#搭建博客" class="headerlink" title="搭建博客"></a>搭建博客</h2><blockquote>
<p>Hexo 与 Github Page配合，建立静态托管网站作为个人博客。其中，Hexo使用的是NexT主题。本文重点记录建立网站后的个性化配置，方便重建参考。</p>
</blockquote>
<p>  首先是创建个人的Github Page，这个在网络上有很多，可以搜索得到。</p>
<p>  下载安装Hexo，在安装Hexo之前，需要先安装Git和Node.js。之后在目标文件夹中安装Hexo即可，具体安装方式参考网络。</p>
<p>  Hexo安装完成后，使用 <code>hexo init</code> 命令进行初始化，初始化完成后，再分别使用 <code>hexo g</code> 和 <code>hexo s</code> 命令生成、运行hexo。</p>
<p>  在本地浏览器打开 <code>http://localhost:4000/</code> 查看是否正常显示。</p>
<p>  配置目录下 <code>_config.yml</code> 文件，设置目标github网站和配置，使用 <code>hexo d</code> 上传更新，等待一会后即可从静态地址中打开博客网站。</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2022/05/08/Hexo-Github%20Pages/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="http://example.com/2021/11/24/Windows-OS-Handle/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="lee">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Youan">
      <meta itemprop="description" content="记录备份">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | Youan">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2021/11/24/Windows-OS-Handle/" class="post-title-link" itemprop="url">Windows OS Handle</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2021-11-24 00:00:00" itemprop="dateCreated datePublished" datetime="2021-11-24T00:00:00+08:00">2021-11-24</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2022-12-06 16:49:04" itemprop="dateModified" datetime="2022-12-06T16:49:04+08:00">2022-12-06</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/windows/" itemprop="url" rel="index"><span itemprop="name">windows</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="Windows-OS-Handle"><a href="#Windows-OS-Handle" class="headerlink" title="Windows OS Handle"></a>Windows OS Handle</h1><h2 id="获取进程句柄（HANDLE）和窗口句柄（HWND）"><a href="#获取进程句柄（HANDLE）和窗口句柄（HWND）" class="headerlink" title="获取进程句柄（HANDLE）和窗口句柄（HWND）"></a>获取进程句柄（HANDLE）和窗口句柄（HWND）</h2><p>当在一台主机中时，可以根据进程的ID获取进程句柄<br>也可以根据进程名称来获取进程句柄，</p>
<h2 id="获取窗口句柄："><a href="#获取窗口句柄：" class="headerlink" title="获取窗口句柄："></a>获取窗口句柄：</h2><p>当想获取窗口句柄时，可以使用窗口的类名或窗口的标题来获取窗口句柄</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2021/11/24/Windows-OS-Handle/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="http://example.com/2021/07/06/Windows-DirectUI/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="lee">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Youan">
      <meta itemprop="description" content="记录备份">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | Youan">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2021/07/06/Windows-DirectUI/" class="post-title-link" itemprop="url">DirectUI介绍</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2021-07-06 00:00:00" itemprop="dateCreated datePublished" datetime="2021-07-06T00:00:00+08:00">2021-07-06</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2022-12-06 15:37:04" itemprop="dateModified" datetime="2022-12-06T15:37:04+08:00">2022-12-06</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/duilib/" itemprop="url" rel="index"><span itemprop="name">duilib</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="DirectUI介绍"><a href="#DirectUI介绍" class="headerlink" title="DirectUI介绍"></a>DirectUI介绍</h1><p>DirectUI是一个软件设计思想，这个思想来源于Windowless理念，这个思想可以表述为“只有主窗口有句柄，其他的窗口都是以控件的形式被绘制出来”，所有采用这个思想设计的开发框架都可以称为DirectUI。目前流行的DirectUI库开源的有duilib，REDUI，Bkuilib， UIFeature， 以及国内有名的几家做UI库的公司的产品，例如上海勇进，炫彩界面库，另外腾讯，迅雷这些公司都有自己的DirectUI库，只是他们不公开，只是自己的产品用。</p>
<p>因为有句柄的窗口消息和原理的公开所以使得它很容易被破解，降低了窗口信息的不安全性，所以就有人想给窗口加上锁来保证窗口信息的安全。 最早加锁的人还是微软自己，MSN要保护用户隐私，搞了个DirectUIHWND，被人发现后，DirectUI这个名称就逐渐扩散开来，也有越来越多的软件给自己的窗口加了锁。</p>
<pre><code>用 DirectUI框架开发的程序本质上是一个Win32程序。与MFC相比较，区别是除了主窗口之外的各种窗口和控件是由微软来实现还是UI库自己实现。各种不同的UI库是通过WindowsAPI的封装来实现自己需要的控件，同时设计出自己消息响应机制。

DirectUI的两大特点，其一是 Windowless理念带来的安全性，另外一个就是界面和逻辑分离为开发带来的高效性。 DirectUI使用XML文件来描述界面显示，通过编程语言来描述界面逻辑。这使得开发效率得到了提高，同时对于为后期的维护降低了工作量。
</code></pre>
<p>对于不同的UI库， 单纯讨论每个库的优劣是没有意义的，而是要放到具体的应用场景里来看，每个库都有自己擅长的场景。 目前 大多数C++的DirectUI停留在XML配置静态UI，然后C++来实现后台逻辑。</p>
<p>DirectUI还有以下优点，基于Win32API，没有framework依赖。易于改变皮肤色调。支持大多数控件透明，包括子窗口透明。</p>

      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="http://example.com/2020/11/16/Git-%E5%AD%A6%E4%B9%A0%E8%AE%B0%E5%BD%95/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="lee">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Youan">
      <meta itemprop="description" content="记录备份">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | Youan">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2020/11/16/Git-%E5%AD%A6%E4%B9%A0%E8%AE%B0%E5%BD%95/" class="post-title-link" itemprop="url">Git学习记录</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2020-11-16 00:00:00" itemprop="dateCreated datePublished" datetime="2020-11-16T00:00:00+08:00">2020-11-16</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2022-12-06 16:46:35" itemprop="dateModified" datetime="2022-12-06T16:46:35+08:00">2022-12-06</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/git/" itemprop="url" rel="index"><span itemprop="name">git</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="Git学习记录"><a href="#Git学习记录" class="headerlink" title="Git学习记录"></a>Git学习记录</h1><p>Git 目前世界上最先进的分布式版本控制系统</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2020/11/16/Git-%E5%AD%A6%E4%B9%A0%E8%AE%B0%E5%BD%95/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="http://example.com/2020/11/13/Windows%E5%B1%8F%E5%B9%95%E5%88%86%E8%BE%A8%E7%8E%87%E4%B8%8EDPI%E7%9A%84%E8%8E%B7%E5%8F%96/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="lee">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Youan">
      <meta itemprop="description" content="记录备份">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | Youan">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2020/11/13/Windows%E5%B1%8F%E5%B9%95%E5%88%86%E8%BE%A8%E7%8E%87%E4%B8%8EDPI%E7%9A%84%E8%8E%B7%E5%8F%96/" class="post-title-link" itemprop="url">Windows屏幕分辨率与DPI的获取</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2020-11-13 00:00:00" itemprop="dateCreated datePublished" datetime="2020-11-13T00:00:00+08:00">2020-11-13</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2022-12-06 16:49:15" itemprop="dateModified" datetime="2022-12-06T16:49:15+08:00">2022-12-06</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/windows/" itemprop="url" rel="index"><span itemprop="name">windows</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="Windows屏幕分辨率与DPI的获取"><a href="#Windows屏幕分辨率与DPI的获取" class="headerlink" title="Windows屏幕分辨率与DPI的获取"></a>Windows屏幕分辨率与DPI的获取</h1><ul>
<li>DPI对屏幕分辨率的影响<br>现在屏幕分辨率越来越高，但是很多软件并没有对高分辨率进行适配，所以在高分辨率之下的界面会显示的很小，很难分辨。这个时候开启DPI功能，也就是缩放与布局，可以改善这个情况。</li>
</ul>
<h2 id="不受DPI影响"><a href="#不受DPI影响" class="headerlink" title="不受DPI影响"></a>不受DPI影响</h2><p>1、不受DPI影响，获取的实际分辨率信息–主屏分辨率</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">HDC hdc = GetDC(NULL);</span><br><span class="line">int firstScreenWidth, hfirstScreenHeight;</span><br><span class="line">firstScreenWidth = GetDeviceCaps(hdc, DESKTOPHORZRES);</span><br><span class="line">hfirstScreenHeight = GetDeviceCaps(hdc, DESKTOPVERTRES);</span><br><span class="line">ReleaseDC(NULL, hdc);</span><br></pre></td></tr></table></figure>

<p>2、实际分辨率（物理显示器分辨率，不受DPI影响）</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">// 获取监视器物理宽度与高度</span><br><span class="line">DEVMODE dm;</span><br><span class="line">dm.dmSize = sizeof(dm);</span><br><span class="line">dm.dmDriverExtra = 0;</span><br><span class="line">EnumDisplaySettings(monitor_info.szDevice, ENUM_CURRENT_SETTINGS, &amp;dm);</span><br><span class="line">int cxPhysical = dm.dmPelsWidth;</span><br><span class="line">int cyPhysical = dm.dmPelsHeight;</span><br></pre></td></tr></table></figure>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2020/11/13/Windows%E5%B1%8F%E5%B9%95%E5%88%86%E8%BE%A8%E7%8E%87%E4%B8%8EDPI%E7%9A%84%E8%8E%B7%E5%8F%96/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="http://example.com/2020/01/10/Duilib-%E8%87%AA%E5%8A%A8%E6%8D%A2%E8%A1%8C/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="lee">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Youan">
      <meta itemprop="description" content="记录备份">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | Youan">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2020/01/10/Duilib-%E8%87%AA%E5%8A%A8%E6%8D%A2%E8%A1%8C/" class="post-title-link" itemprop="url">duilib 控件文字自动换行</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2020-01-10 00:00:00" itemprop="dateCreated datePublished" datetime="2020-01-10T00:00:00+08:00">2020-01-10</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-01-04 20:18:12" itemprop="dateModified" datetime="2023-01-04T20:18:12+08:00">2023-01-04</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/duilib/" itemprop="url" rel="index"><span itemprop="name">duilib</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="Duilib-自动换行的处理"><a href="#Duilib-自动换行的处理" class="headerlink" title="Duilib-自动换行的处理"></a>Duilib-自动换行的处理</h1><p>Duilib中自动没有自动换行的属性，如果需要实现自动换行，就需要在代码中计算总字体的长度，根据需要添加‘\n’换行符进行换行。 </p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2020/01/10/Duilib-%E8%87%AA%E5%8A%A8%E6%8D%A2%E8%A1%8C/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="http://example.com/2019/09/25/Windows-kernel/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="lee">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Youan">
      <meta itemprop="description" content="记录备份">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | Youan">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2019/09/25/Windows-kernel/" class="post-title-link" itemprop="url">Windows核心编程-内核对象</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2019-09-25 00:00:00" itemprop="dateCreated datePublished" datetime="2019-09-25T00:00:00+08:00">2019-09-25</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2022-12-06 16:48:18" itemprop="dateModified" datetime="2022-12-06T16:48:18+08:00">2022-12-06</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/windows/" itemprop="url" rel="index"><span itemprop="name">windows</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="内核对象"><a href="#内核对象" class="headerlink" title="内核对象"></a>内核对象</h1><p>何为内核对象：每个内核对象都只是一个内存块，它由操作系统内核分配，并只能由操作系统内核访问。这个内存块是一个数据结构，其成员维护着与对象相关的信息。</p>
<ul>
<li>内核对象的成员中，只有少数成员（如安全属性，使用计数等）是所有对象都有的，其他大多数成员都是不同类型的对象特有的。</li>
</ul>
<hr>
<h2 id="句柄-Handle"><a href="#句柄-Handle" class="headerlink" title="句柄-Handle"></a>句柄-Handle</h2><p>应用程序在操纵内核对象时可以通过Windows提供的一组特定的函数来访问。而使用这些特定的函数来操纵内核对象时，需要传入一个神奇的东西–句柄。什么是句柄呢，当我们创建一个内核对象时，系统为了保护内核对象不被外部访问，会返回一个参数，这个参数就是句柄（Handle），它标识了所创建的对象，可以把这个句柄想象成一个不透明（opaque）的值，它可以由进程中的任何线程使用。在32位系统中，它是一个32位的值，在64位系统中，它是一个64位的值。</p>
<p>所以，总结一下上面的内容：内核对象是操作系统内核分配的，并且只能由操作系统内核访问的内存块。应用程序如果希望操纵内核对象，就需要使用Windows提供的一组特定函数，并且传入创建内核对象时返回的句柄，该句柄标识了希望操纵的目标内核对象。</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2019/09/25/Windows-kernel/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="http://example.com/2019/09/24/WinDbgWithNull-modemLine/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="lee">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Youan">
      <meta itemprop="description" content="记录备份">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | Youan">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2019/09/24/WinDbgWithNull-modemLine/" class="post-title-link" itemprop="url">WinDbg With Null-Modem</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2019-09-24 00:00:00" itemprop="dateCreated datePublished" datetime="2019-09-24T00:00:00+08:00">2019-09-24</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2022-12-06 16:47:57" itemprop="dateModified" datetime="2022-12-06T16:47:57+08:00">2022-12-06</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/windows/" itemprop="url" rel="index"><span itemprop="name">windows</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="Windows-Vista-使用-Null-Modem-电缆的引导选项"><a href="#Windows-Vista-使用-Null-Modem-电缆的引导选项" class="headerlink" title="Windows Vista 使用 Null-Modem 电缆的引导选项"></a>Windows Vista 使用 Null-Modem 电缆的引导选项</h1><p>在Windows Vista中，调试设置可以配置为全局或者针对单个引导入口。默认的全局调试设置是串口通信的，使用COM1，波特率为115200.</p>
<h2 id="要显示当前设置，使用下面的命令："><a href="#要显示当前设置，使用下面的命令：" class="headerlink" title="要显示当前设置，使用下面的命令："></a>要显示当前设置，使用下面的命令：</h2><p><strong>bcdedit &#x2F;dbgsettings</strong></p>
<table>
<thead>
<tr>
<th>Item</th>
<th>Value</th>
</tr>
</thead>
<tbody><tr>
<td>debugtype</td>
<td>Serial</td>
</tr>
<tr>
<td>debugport</td>
<td>1</td>
</tr>
<tr>
<td>baudrate</td>
<td>115200</td>
</tr>
</tbody></table>
<p>使用BCDEdit，要使用提升的权限打开一个命令行窗口（右键点击命令提示符并在快捷菜单中点击用管理员方式启动）。</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2019/09/24/WinDbgWithNull-modemLine/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>





</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2023</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">lee</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/pisces/" rel="noopener" target="_blank">NexT.Pisces</a> 强力驱动
  </div>

    </div>
  </footer>

  
  <script src="https://cdn.jsdelivr.net/npm/animejs@3.2.1/lib/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script>

  





  





</body>
</html>
